package com.feicheng.lanniao.service.impl;

import com.feicheng.lanniao.entity.Car;
import com.feicheng.lanniao.entity.CarRentalInfo;
import com.feicheng.lanniao.exception.SystemException;
import com.feicheng.lanniao.mapper.CarRentalInfoMapper;
import com.feicheng.lanniao.result.ResultInfo;
import com.feicheng.lanniao.service.ICarRentalInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author feichengTech
 * @since 2021-09-02
 */
@Service
public  class CarRentalInfoServiceImpl extends ServiceImpl<CarRentalInfoMapper, CarRentalInfo> implements ICarRentalInfoService {
	/**
	 * @see.ICarRentalInfoService.addOneRental
	 */

	@Override
	public ResultInfo addOneRental(Car car) {
		// TODO Auto-generated method stub
		CarRentalInfo carRentalInfo = new CarRentalInfo();
		carRentalInfo.setCarId(car.getCarId());
		carRentalInfo.setRentalPrice(car.getRentalPrice());
		this.save(carRentalInfo);
		return ResultInfo.success();
	}

	

}
